#pragma once
#include "Drawable.h"
#include "Camera.h"


#include <vector>

using namespace std;

class CBat :
	public CDrawable
{
public:
	CBat(CPhysics* pPhysics, float3 f3Position, GLfloat fSurface[4]);
	~CBat(void);

	int Draw();
	int Update();
	int Score(int iValue);		// add player's score , @param iValue - score to add
	//moving routines:
	int MoveLeft();
	int MoveRight();

	//called when player fail to catch the ball and it go out the board on his side:
	int Fail();
	
	// load texture for bat
	static void LoadTexture();

	float GetLength() { return m_fLength; }

	float GetSpeed() { return m_fSpeed; }
	
	int GetLives() { return m_iLives; }
	
	long int GetScore() { return m_liScore; }

	void SetRelease(bool bRelease) { m_bRelease = bRelease; }
	bool GetRelease() { return m_bRelease; }

	CCamera* GetCamera() {return m_pCamera; }

	int GetType(){return TYPE_BAT;}

	GLfloat* GetSurface() { return m_fBatSurface; }

	void SwitchDynamicCamera(bool bEnabled);

private:
	float m_fLength;
	float m_fSpeed;
	GLfloat m_fBatSurface[4];
	CCamera* m_pCamera;

	static GLuint m_uiTexture;

	//player-specific values:
	int m_iLives;		//palyer's lives
	long int m_liScore;	//player's score
	bool m_bRelease;	//set if player wants to release trapped ball

	bool m_bOver;		//set if player looses his all lives, and fails again
};
